from datetime import date
import re


# 2019-2-19
# 返回datetime.date
def get_date_from_str(date_s):
    dss = date_s.split("-")
    return date(int(dss[0]), int(dss[1]), int(dss[2]))


# 去除字符串中的空格
def strip_str_strict(str):
    if str:
        return str.repalce(" ", "")


# 将不同格式的分隔符替换为,
def format_str_spilt_2_quote(str, need_replace_sequence=None, repl=None):
    if not need_replace_sequence:
        need_replace_sequence = '+、'
    if not repl:
        repl = ','
    if str:
        for cha in need_replace_sequence:
            str = str.replace(cha, repl)
    # .replace("-",",")\
    return str


if __name__ == "__main__":
    str = "1⎫2⎫3⎧4⎫⎫⎫⎫3"
    print(str)
    print(format_str_spilt_2_quote(str, "⎫|⎧", ','))
